****** Table_7_2: Natural harbors and economic development
*** Pop
use data/Demo_book_country_3.dta, clear

*1) bivariate
qui reg pop_hyd_sum predallports53_100km cc.year##c.year, vce(cluster gid)
qui local clusters=e(N_clust)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_2.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "Clusters", `clusters', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) replace
qui drop sample

*2) full
qui reg pop_hyd_sum predallports53_100km equator_distance ocdistance rivdist temp irrig_sum c.prec_gpcc##c.prec_gpcc crop pasture forest grass shrub savanna barren water mountains i.e_regionpol4 i.country_id cc.year##c.year, vce(cluster gid)
qui local clusters=e(N_clust)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_2.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "Clusters", `clusters', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*** Urban

*3) bivariate
qui reg urban predallports53_100km cc.year##c.year, vce(cluster gid)
qui local clusters=e(N_clust)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_2.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "Clusters", `clusters', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*4) specifications with all the geo vars create collinearity
qui reg urban predallports53_100km equator_distance ocdistance rivdist temp irrig_sum c.prec_gpcc##c.prec_gpcc i.e_regionpol4 i.country_id cc.year##c.year, vce(cluster gid)
qui local clusters=e(N_clust)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_2.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "Clusters", `clusters', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*** gross cell product

*5) bivariate
qui reg gcp_ppp predallports53_100km i.year, vce(cluster gid)
qui local clusters=e(N_clust)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_2.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "Clusters", `clusters', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample

*6) full
qui reg gcp_ppp predallports53_100km equator_distance ocdistance rivdist temp irrig_sum c.prec_gpcc##c.prec_gpcc i.e_regionpol4 i.country_id i.year, vce(cluster gid)
qui local clusters=e(N_clust)
qui gen sample = e(sample)
qui tab country_id if sample == 1, nofreq
qui local countries=r(r)
qui tab year if sample == 1, nofreq
qui local years=r(r)
qui outreg2 using output/Table_7_2.doc, nor noni nonot nocon stats(coef tstat) addstat("Countries", `countries', "Years", `years', "Clusters", `clusters', "R-squared", e(r2)) addn("*** p<0.01, ** p<0.05, * p<0.1") se bdec(3) keep(predallports53_100km) append
qui drop sample
